Advertisement
Guest User

Untitled

a guest
Jan 11th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. # pins.hal sets up hardware probe to signal 'probe'
  2.  
  3. # Add a lowpass filter to probe signal when not in a probing move
  4.  
  5. ###########################
  6. # Setup lowpass component #
  7. ###########################
  8. loadrt lowpass names=probe-lowpass
  9. addf probe-lowpass servo-thread
  10.  
  11. # For a sampling period T (seconds),
  12. # the gain for this Hal lowpass component is:
  13. # gain = 1 - e^(-a * T)
  14. # Example:
  15. # T = 0.001 seconds (typical servo thread period)
  16. # a = (2*pi*100) (100Hz bandwith single pole)
  17. # gain = 0.466
  18.  
  19. sets probe-lowpass.gain 0.466
  20.  
  21. ################################
  22. # Setup motion-type comparator #
  23. ################################
  24. loadrt comp names=motion-eq-probing
  25. addf motion-eq-probing servo-thread
  26.  
  27. # When probing motion.motion−type == 5
  28. setp motion-eq-probing.in0 5
  29. net motion-type motion-eq-probing.in1 <= motion.motion−type
  30.  
  31. net disable-probe-lowpass motion-eq-probing.equal => probe-lowpass.load
  32.  
  33. # Probe signal via lowpass component
  34. net probe => probe-lowpass.in
  35. net probe-filtered probe-lowpass.out => motion.probe-input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement